package com.lovegu.os;

import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;

/**
 * @author 老顾
 * @title: One
 * @projectName java-restudy
 * @email: 1437594522@qq.com
 * @date 2022/10/13 19:55
 */
public class One {
    //进程名
    private static final String[] PROCESS_NAME = new String[3];
    //优先级数
    private static final Integer[] PRIORITY = new Integer[3];
    //运行时间
    private static final Integer[] PTIME = new Integer[3];
    //完成时间
    private static final int[] TIME = new int[3];
    //平均作业周转时间
    private static int avgTime;
    public static void main(String[] args) {
        //输入数据
        Scanner scanner = new Scanner(System.in);
        for (int i = 0; i < 3; i++) {
            PROCESS_NAME[i] = scanner.next();
            PRIORITY[i] = scanner.nextInt();
            PTIME[i] = scanner.nextInt();
        }
        //周转时间排序
        Arrays.sort(PTIME, Collections.reverseOrder());
        //计算周转时间
        for (int i = 0; i < 3; i++) {
            if (i == 0){
                TIME[i] = PTIME[i];
            }else if (i==1){
                TIME[i] = PTIME[i] + PTIME[i - 1];
            }else {
                TIME[i] = PTIME[i] + PTIME[i - 1]+PTIME[i - 2];
            }
            //计算平均作业周转时间
            avgTime += TIME[i];
        }
        //保留小数点后1位并四舍五入
        String result = String.format("%.1f",avgTime / 3.0);
        System.out.println(result);
    }
}
